package gui;

import java.awt.Color;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;

import fiziksobject.FiziksBall;

import physics.Location;
import physics.PhysicsEngine;
import physics.Vector;
import physics.Vector.Type;

public class PhysicsSettings implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Hashtable<Vector.Type, Color> thingColors;
	private double scale = 10;
	private boolean showForces;
	private boolean stableCollisions;
	private FiziksBall def;

	public PhysicsSettings() {
		thingColors = new Hashtable<Vector.Type, Color>();
		for (Vector.Type i : Vector.Type.values()) {
			thingColors.put(i, Color.BLACK);
		}
		System.out.println("hello");
		thingColors.put(Vector.Type.FORCE_ELECTRIC, Color.ORANGE);
		thingColors.put(Vector.Type.FORCE_GRAVITY, Color.GREEN);
		thingColors.put(Vector.Type.FORCE_MAGNETIC, Color.BLUE);
		thingColors.put(Vector.Type.FORCE_NORMAL, Color.WHITE);
		thingColors.put(Vector.Type.MOMENTUM, Color.RED);
		thingColors.put(Vector.Type.FORCE_SPRING, Color.MAGENTA);
		def = new FiziksBall(1, 0, new Vector().toType(Type.MOMENTUM),
				new Location(), 1);
	}

	public Color getColor(Type type) {
		return thingColors.get(type);
	}

	public void setColor(Type type, Color color) {
		thingColors.put(type, color);
	}

	public void setScale(double d) {
		scale = d;
	}

	public double getScale() {
		return scale;
	}

	public boolean getShowForces() {
		return showForces;
	}

	public void setShowForces(boolean b) {
		showForces = b;
	}
	public boolean getStableCollisions(){
		return stableCollisions;
	}
	public void setStableCollisions(boolean b){
		stableCollisions = b;
		PhysicsEngine pe = PhysicsEngine.getPhysicsEngine();
		pe.setIsStableCode(b);
		
	}
}
